package com.moli.iov.alarm.model.po;

import lombok.Data;

import java.io.Serializable;

@Data
public class StatAlarm implements Serializable {

    public static final String DEFAULT_VALUE = "defaultValue";

    public static final String OUT_FENCE_ALARM_COUNT = "outFenceAlarmCount";

    public static final String IN_FENCE_ALARM_COUNT = "inFenceAlarmCount";

    public static final String MILEAGE_EXCEPTION_CHANGE_COUNT = "mileageExceptionChangeCount";

    public static final String OFF_LINE_COUNT = "offLineCount";

    public static final String ONE_LEVEL_ALARM_COUNT = "oneLvAlarmCount";

    public static final String TWO_LEVEL_ALARM_COUNT = "twoLvAlarmCount";

    public static final String THREE_LEVEL_ALARM_COUNT = "threeLvAlarmCount";

    public static final String COMPANY_ID = "companyId";

    public static final String ALARM_DATE = "date";

    public static final String VEHICLE_COUNT = "vehicleCount";

    private Long outFenceAlarmCount;
    private Long inFenceAlarmCount;

    private Long oneLvAlarmCount;
    private Long twoLvAlarmCount;
    private Long threeLvAlarmCount;

    private Long offLineCount;
    private Long mileageExceptionChangeCount;

    private String date;
    private Long companyId;
    private Long vehicleCount;

    public StatAlarm(){
        this.outFenceAlarmCount = 0L;
        this.inFenceAlarmCount = 0L;

        this.oneLvAlarmCount= 0L;
        this.twoLvAlarmCount= 0L;
        this.threeLvAlarmCount= 0L;

        this.offLineCount= 0L;
        this.mileageExceptionChangeCount= 0L;
        this.vehicleCount= 0L;
    }

    public void add(StatAlarm statAlarm){
        if(statAlarm != null){
            this.outFenceAlarmCount += statAlarm.getOutFenceAlarmCount();
            this.inFenceAlarmCount += statAlarm.getInFenceAlarmCount();
            this.oneLvAlarmCount += statAlarm.getOneLvAlarmCount();
            this.twoLvAlarmCount += statAlarm.getTwoLvAlarmCount();
            this.threeLvAlarmCount += statAlarm.getThreeLvAlarmCount();
            this.offLineCount += statAlarm.getOffLineCount();
            this.mileageExceptionChangeCount += statAlarm.getMileageExceptionChangeCount();
            this.vehicleCount += statAlarm.getVehicleCount();
        }
    }
}
